package 纯数组;

/**
 * @description:
 * @author: 小白白
 * @create: 2021-10-01
 **/

public class No268丢失的数字 {

    public int missingNumber(int[] nums) {

        int num = 0;
        for (int i = 0; i < nums.length; i++) {
            num ^= i;
            num ^= nums[i];
        }
        num ^= nums.length;

        return num;
    }

}
